package com.weseal.query;

import org.apache.commons.collections.CollectionUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author weixiaoqing
 * @description
 * @create 2017/9/6
 * @company 上海富捷信息技术有限公司
 */
public class PageQuery implements Serializable {
	private static final long serialVersionUID = 376600555466274198L;

	private Integer pageNum = 1;
	private Integer pageSize = 10;

	private List<Order> orders;

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}
	
	public Integer getPageNum() {
		return pageNum;
	}

	public void setPageNum(Integer pageNum) {
		this.pageNum = pageNum;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public List<Order> getOrders() {
		return orders;
	}

	public void setOrders(List<Order> orders) {
		this.orders = orders;
	}

	public void addOrder(String alias) {
		Order order = new Order(alias);
		if (CollectionUtils.isEmpty(orders)) {
			orders = new ArrayList<Order>();
		}
		orders.add(order);
	}
}
